<!--
 * @Date: 2025-06-23 15:42:29
 * @LastEditors: Csir 2215995096@qq.com
 * @LastEditTime: 2025-07-01 11:40:33
 * @FilePath: \yujin-ui-admin\src\views\wujie\order\index.vue
-->
<!--
 * @Date: 2025-06-19 09:56:07
 * @LastEditors: Csir 2215995096@qq.com
 * @LastEditTime: 2025-06-25 18:04:41
 * @FilePath: \yujin-ui-admin\src\views\wujie\order\index.vue
-->
<template>
  <div class="container">
    <!-- https://qiankun.umijs.org -->
    <!-- http://localhost:8099/ -->
    <!-- http://192.168.8.125:80/ -->

    <!-- :props="{
          fetchData: fetchAPIMethod,
          info: {
            token: Authorization
          }
        }" -->

    <div class="app-container">
      <WujieVue
        width="100%"
        height="100%"
        name="guanlanchang"
        url="http://localhost:81/manage/work-order-manage"
        :sync="true"
        :exec="false"
        :alive="true"
        :degrade="false"
        :plugins="[
          {
            patchElementHook(element, iframeWindow) {
              if (element.nodeName === 'SCRIPT') {
                element.crossOrigin = 'anonymous' // 添加跨域属性
              }
              if (element.nodeName == 'STYLE') {
                //处理element 样式问题
                element.insertAdjacentElement = function (_position, ele) {
                  iframeWindow.document.head.appendChild(ele)
                }
              }
            }
          }
        ]"
      />
    </div>
  </div>
</template>
<script setup>
import { getAccessToken } from '@/utils/auth'

const token = getAccessToken()

const Authorization = `Bearer ${token}`

const fetchAPIMethod = () => {
  console.log('子应用调用主应用方法')
}
</script>
<style scoped lang="less">
.container {
  width: 100vw;
  height: 100vh;
  display: flex;
}

.app-container {
  width: 100%; /* 固定宽度 */
  height: 100%; /* 固定高度 */
  position: absolute; /* 固定位置 */
  top: 50%; /* 距离顶部的位置 */
  left: 50%; /* 距离左边的位置 */
  transform: translate(-50%, -50%); /* 使容器居中 */
  border: 1px solid #ddd; /* 可选：添加边框 */
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); /* 可选：添加阴影 */
  overflow: hidden; /* 隐藏超出部分 */
}
</style>
